package com.lib.handler;

import com.alibaba.fastjson.JSON;

import com.lib.builder.*;
import com.lib.dto.WxMenuKey;
import com.lib.service.BaseWxService;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

import java.util.Map;

/**
 * 
 * @author Binary Wang
 *
 */
public abstract class MenuHandler extends AbstractHandler {

  @Override
  public abstract WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
      Map<String, Object> context, WxMpService wxMpService,
      WxSessionManager sessionManager) ;

  public AbstractBuilder getBuilder(WxMenuKey menuKey){
      AbstractBuilder builder = null;
      switch (menuKey.getType()) {
        case WxConsts.XML_MSG_TEXT:
          builder = new TextBuilder();
          break;
        case WxConsts.XML_MSG_IMAGE:
          builder = new ImageBuilder();
          break;
        case WxConsts.XML_MSG_VOICE:
          break;
        case WxConsts.XML_MSG_VIDEO:
          break;
        case WxConsts.XML_MSG_NEWS:
          break;
        default:
          break;
      }

      return builder;
  }

}
